package com.zm.rpc.procedure.pojo;

public class ProcedureCallResult {
    private Object result;
    private Boolean isSucceed;
    private String errorMsg;
    private ProcedureMetadata metadata;
    
    public static ProcedureCallResult OK(Object r,ProcedureMetadata metadata){
        ProcedureCallResult result = new ProcedureCallResult();
        result.setIsSucceed(true);
        result.setResult(r);
        result.setMetadata(metadata);
        return result;
    }

    public static ProcedureCallResult ERROR(String errorMsg,ProcedureMetadata metadata){
        ProcedureCallResult result = new ProcedureCallResult();
        result.setIsSucceed(false);
        result.setErrorMsg(errorMsg);
        result.setMetadata(metadata);
        return result;
    }


    private ProcedureCallResult(){}
    public Object getResult() {
        return result;
    }
    public void setResult(Object result) {
        this.result = result;
    }
    public Boolean getIsSucceed() {
        return isSucceed;
    }
    public void setIsSucceed(Boolean isSucceed) {
        this.isSucceed = isSucceed;
    }
    public String getErrorMsg() {
        return errorMsg;
    }
    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public ProcedureMetadata getMetadata() {
        return metadata;
    }

    public void setMetadata(ProcedureMetadata metadata) {
        this.metadata = metadata;
    }

    
}
